<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="java.util.*,
						com.ophelisis.common.util.*,
						com.ophelisis.common.consts.*,
						com.ophelisis.actions.system.*"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<script>
$(document).ready(function() {
	$("#searchForm").find("input[type=text]").attr("disabled","disabled");
	$("#searchForm").find("input[type=password]").attr("disabled","disabled");
	$("#searchForm").find("input[type=radio]").attr("disabled","disabled");
	$("#searchForm").find("input[type=file]").hide();
	$("#searchForm").find("select").attr("disabled","disabled");
	$("#searchForm").find("textarea").attr("disabled","disabled");
	$(".btnModify").show();
	$(".btnSave").hide();
	$("#btnZipcode").hide();
	
	if (checkUserAuth() < 2) {
		$(".btnModify, .btnSave").hide();
		$("#btnList").show();
	}
});
</script>
<%@ include file="/WEB-INF/jsp/common/resultMessageLocal.jsp"%>
<div id="formlist1" class="noborder">
	<input type="hidden" id="loadCheck" name="loadCheck" value="OK" />
	<form id="searchForm" name="searchForm" method="post">
    	<input type="hidden" id="searchVal1" name="searchVal1" value="${searchVal1}" />
    	<input type="hidden" id="isNew" name="isNew" value="N" />
		<table class="viewstyle1">
			<c:choose>
				<c:when test="${userList != '' && !empty userList}">
					<c:forEach var="list" items="${userList}" varStatus="status">
				    	<input type="hidden" id="userId" name="userId" value="${list.userId}" />
    					<input type="hidden" id="userZipcode" name="userZipcode" value="${list.userZipcode}" />
						<colgroup>
							<col width="130" />
							<col width="220" />
							<col width="130" />
							<col width="" />
						</colgroup>
						<tr>
							<td colspan="4" class="titleColumn">기본 정보</td>
						</tr>
						<tr>
							<th scope="col">사용자 ID</th>
							<td scope="col"><span class="pdl5">${list.userId}</span></td>
							<th scope="col">사용자 비밀번호</th>
							<td scope="col" ><input type="password" id="userPassword" name="userPassword" class="in3 intex_l width_200p" value="${list.userPassword}" /></td>
						</tr>
						<tr>
							<th>사용자 이름</th>
							<td><input type="text" id="userNm" name="userNm" class="in3 intex_l width_200p" value="${list.userNm}" /></td>
							<th>사용 여부</th>
				            <td>
				            <input type="radio" id="useYn1" name="useYn" value="Y" <c:if test="${list.useYn == 'Y'}">checked="checked"</c:if> /> 사용
							<input type="radio" id="useYn2" name="useYn" value="N" <c:if test="${list.useYn == 'N'}">checked="checked"</c:if> /> 미사용
				            </td>
						</tr>
						<tr>
							<th>생년월일</th>
							<td><input type="text" id="userBirthday" name="userBirthday" class="in3 intex_l width_80p" value="${list.userBirthday}" readonly="readonly" /></td>
							<th>전화번호</th>
							<td><input type="text" id="userTel" name="userTel" class="in3 intex_l width_200p" value="${list.userTel}" /></td>
						</tr>
						<tr>
							<th>주소</th>
							<td colspan="3">
							<div class="flo_l"><input type="text" id="zipcode1" name="zipcode1" class="in3 intex_l width_50p" value="${fn:split(list.userZipcode,'-')[0]}" readonly="readonly" /> - <input type="text" id="zipcode2" name="zipcode2" class="in3 intex_l width_50p" value="${fn:split(list.userZipcode,'-')[1]}" readonly="readonly" /></div>
							<div class="flo_l">&nbsp;<img src="images/btn/btn_post.gif" id="btnZipcode" class="pdt3 clickable" /></div>
							<div class="flo_c"><input type="text" id="userAddress" name="userAddress" class="in3 intex_l width_200p" value="${list.userAddress}" /> <input type="text" id="userAddressDetail" name="userAddressDetail" class="in3 intex_l width_400p" value="${list.userAddressDetail}" /></div>
							</td>
						</tr>
					</c:forEach>
				</c:when>
			</c:choose>
		</table>
	</form>
	<div id="lowbtn">
		<a href="javascript:pmModule.setDelete();" class="btnModify"><img src="images/btn/btn_delete01.gif" /></a> 
		<a href="javascript:pmModule.setModify();" class="btnModify"><img src="images/btn/btn_modify01.gif" /></a> 
		<a href="javascript:pmModule.getList();" class="btnModify"><img src="images/btn/btn_list01.gif" /></a>
		
		<a href="javascript:pmModule.reset('reset');" class="btnSave"><img src="images/btn/btn_cancel01.gif" /></a>
		<a href="javascript:pmModule.save();" class="btnSave"><img src="images/btn/btn_save01.gif" /></a>  
		<a href="javascript:pmModule.getList('reset');" id="btnList" class="btnSave"><img src="images/btn/btn_list01.gif" /></a>
	</div>
</div>
